package com.zkthink.ceres.applet.check.controller;

import com.zkthink.base.R;
import com.zkthink.ceres.applet.check.domain.entry.CheckRecord;
import com.zkthink.ceres.applet.check.domain.vo.SignVo;
import com.zkthink.ceres.applet.check.service.CheckRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Date;

import static com.zkthink.ceres.applet.authority.config.AuthorityWebConfiguration.getMid;

/**
 * @Author cmz
 * @Date 2024-05-18 11:28
 */

@Slf4j
@Validated
@RestController
@RequestMapping("/applet/check")
@Api(value = "check", tags = "签到信息")
public class CheckController {
    @Resource
    private CheckRecordService checkRecordService;

    @ApiOperation("查询当前登录的用户今天是否签到")
    @GetMapping("/findMyToDayIsCheck")
    public R findMyToDayIsCheck(){
        return checkRecordService.findMyToDayIsCheck();
    }

    @ApiOperation("用户签到")
    @PostMapping("/sign")
    public R sign(@RequestBody  SignVo signVo){
        return checkRecordService.sign(signVo);
    }
}
